let successUrl = basePath + "/verify/success";
let failureUrl = basePath + "/verify/failure";

function toSuccess() {
    $.post(successUrl, {
        id: $("#id").val(),
        note: $("#note").val()
    }, function (data) {
        data = eval("(" + data + ")");
        if (data.success)
            $("#main-page").load(basePath + "verify/list", { page: $("#page").val() });
        
        if (!data.success) $("#errorMsg").html(data.message);
    })
}


function toFailure() {
    let note = $.trim($("#note").val());
    if(note.length === 0) {
        $("#errorMsg").html("请填写审核失败理由！");
        return;
    }
    
    $.post(failureUrl, {
        id: $("#id").val(),
        note: note
    }, function (data) {
        data = eval("(" + data + ")");
        if (data.success)
            $("#main-page").load(basePath + "verify/list", { page: $("#page").val() });

        if (!data.success) $("#errorMsg").html(data.message);
    })
}